function [F, G] = PredIntegral(e, absBank, absBankf, statec, statef, signOfBankp, StogoExp, tgoExp)
global dtIntPred dtGuiPred ef
num = 0;
k = dtGuiPred/dtIntPred;
a = 0;
b = (absBank - absBankf)/(e - ef);
c = absBankf - b*ef;
bankabc = [a b c];
state_temp = statec;
[alphac, ~, signOfBank] = PredGuidanceLoop(state_temp, statef, signOfBankp, bankabc);
ctrl_temp = [alphac absBank signOfBank];
while 1
    state_temp = RK4(@ReentryDynamic, state_temp, ctrl_temp, dtIntPred);
    if k <= 0
        [alphac, absBank, signOfBank] = PredGuidanceLoop(state_temp, statef, signOfBankp, bankabc);
        ctrl_temp = [alphac absBank signOfBank];
        k = dtGuiPred/dtIntPred;
    end
    r = state_temp(1);
    V = state_temp(4);
    e = 1/r - V^2/2;
    num = num + 1;
    k = k - 1;
    if e >= ef
        break;
    end
end
statefPred = state_temp;
rad  = statec(1);
lon = statec(2);
lat = statec(3);
radfPred  = statefPred(1);
lonfPred = statefPred(2);
latfPred = statefPred(3);
% StogoPred = sqrt((rad-radfPred)^2 + (acos(sin(lat)*sin(latfPred) + ...
%     cos(lat)*cos(latfPred)*cos(lonfPred-lon)))^2);
StogoPred = acos(sin(lat)*sin(latfPred) + ...
    cos(lat)*cos(latfPred)*cos(lonfPred-lon));
tgoPred = num*dtIntPred;
F = StogoPred - StogoExp;
G = tgoPred - tgoExp;
end